package com.definesys.smecrailtransit.module.EleRecord;

import android.content.Context;

import com.definesys.smecrailtransit.SmecManager.SmecRetrofit.BaseSubscriber;
import com.definesys.smecrailtransit.SmecManager.SmecRetrofit.HttpResult;
import com.definesys.smecrailtransit.base.SmecBasePresenter;
import com.definesys.smecrailtransit.module.SiteDetails.bean.EleParamAchievesBean;

import java.util.HashMap;

import rx.Observable;

import static com.definesys.smecrailtransit.module.EleRecord.EleRecordFragment.GET_ELE_RECORD_SUCCESS;


/**
 * Created by xupeizuo on 2018/4/24.
 */

public class EleRecordPresenter extends SmecBasePresenter {

    public EleRecordPresenter(Context mContext) {
        super(mContext);
    }
    public void getParamAchieves(HashMap<String, Object> map) {
        Observable<HttpResult<EleParamAchievesBean>> observable=smecRailService.getParamAchieves(map);
        schedulerThread(observable).subscribe(new BaseSubscriber<HttpResult<EleParamAchievesBean>>() {

            @Override
            public void onNext(HttpResult<EleParamAchievesBean> eleParamAchievesBeanHttpResult) {
                mRxbus.post(GET_ELE_RECORD_SUCCESS,eleParamAchievesBeanHttpResult.getData());
            }
        });
    }
}
